package org.fdy.bgadmin.controller.business;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.fdy.bgadmin.service.OcrService;
import org.fdy.common.core.model.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>描述：</p>
 *
 * @author fangdy
 * @create 2024-01-02 23:24
 */

@RestController
@RequestMapping("/ocr")
@RequiredArgsConstructor
@Api(tags = "ocr 接口")
public class OcrController {

    private final OcrService ocrService;

    @PostMapping("/fileToText")
    @ApiOperation("图片文件转换为字符数组")
    public Result<List<String>> fileToText(@RequestParam("file") MultipartFile file) {
        return ocrService.fileToText(file);
    }
}
